<template>

    <div class="wrap-box1">
        <van-nav-bar
            title="标题1"
            left-arrow
            @click-left="onClickLeft"
        />
        <div class="box" @click="jumpTwo">跳转demo2</div>
    </div>    
</template>
  

<script setup lang="ts">
import { useRoute, useRouter } from "vue-router";
import {onMounted,onActivated, onDeactivated} from "vue";

const router = useRouter()
const onClickLeft = () => router.back();

const jumpTwo = () => {
    router.push('/work/demo2')
}
onMounted(() => {
    console.log('demo1onMounted');
})
 
onActivated(() => {
  console.log('demo1被激活');
});
onDeactivated(() => {
  console.log('demo1离开');
});
</script>


<style scoped lang="less">
.wrap-box1{
    width:100%;
    height:100%;
    font-size:32px;
    .box{
        width:100px;
        height:80px;
        background-color:pink;
    }
}
</style>
